home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Add-Ons / MicroPhone / Open Mike™ / Open Mike™ 011 / Mike's Folder / Tips & Tricks < prev    next >
Encoding:
Text File  |  1993-11-01  |  2.8 KB  |  59 lines  |  [TEXT/ttxt]

  1. Tips & Tricks
  2. =============
  3. Copyright © 1993 by Celestin Company
  4. All rights reserved.
  5.  
  6. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without permission in writing from the publisher. However, you are permitted to make copies of this work, printed or otherwise, as long as said copies are for your personal use only.
  7.  
  8. Introduction
  9. ------------
  10. If you've got a tip or a trick that you think would benefit other Open Mike readers, please share it with us. Readers whose tip or trick we use will receive a free issue of Open Mike. Such a deal!
  11.  
  12. By special request, this time around we discuss a specific topic of interest: making buttons appear in the button bar in the order that you want them to.
  13.  
  14. When you create scripts with MicroPhone and assign the button attribute to them, they appear in the button bar in alphabetical order. So, if you have three scripts (Log On, Log Off, Get Mail), they appear in this order:
  15.  
  16.   (Get Mail) (Log Off) (Log On)
  17.  
  18. Now, what if you don't want them in this order? What if you want them to appear like this:
  19.  
  20.   (Log On) (Get Mail) (Log Off)
  21.  
  22. What you need to do is remove the button attribute from each of these scripts. Then, create a new script that does the following:
  23.  
  24.   Remove All Buttons
  25.   Install Button "'Log On'"
  26.   Install Button "'Get Mail'"
  27.   Install Button "'Log Off'"
  28.  
  29. Then, go to the Settings menu and select Turnkey Actions. Make the new script the startup action. This way, when you open the settings document, the script that installs these buttons in the order you want will be executed automatically.
  30.  
  31. But wait! It doesn't really make sense to have a Log On and Log Off button in the same button bar, does it? That's right. For a situation like this, you might have the startup script do just the following:
  32.  
  33.   Remove All Buttons
  34.   Install Button "'Log On'"
  35.  
  36. Then, only one button will appear in the button bar. Modify your Log On script so that it changes the button bar after it has successfully logged on, like this:
  37.  
  38.   Remark "--- Log On script ---"
  39.   ...
  40.   Remove All Buttons
  41.   Install Button "'Get Mail'"
  42.   Install Button "'Log Off'"
  43.  
  44. You should replace the ... with whatever the Log On script needs to do in order to log on to your service. Then, modify your Log Off script so that it changes the button bar after it has successfully logged off, like this:
  45.  
  46.   Remark "--- Log Off script ---"
  47.   ...
  48.   Remove All Buttons
  49.   Install Button "'Log On'"
  50.  
  51. Now, you've created two different button bars. The first button bar appears when you are not logged on to the service:
  52.  
  53.   (Log On)
  54.  
  55. The second button bar appears when you have successfully logged on to the service:
  56.  
  57.   (Get Mail) (Log Off)
  58.  
  59. Finally, the first button bar appears again when you have successfully logged off from the service.